package cloth.dao;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

import cloth.vo.OrderHistoryVO;

public class OrderHistoryDAO {
	private SqlMapClientTemplate client;
	public OrderHistoryDAO(){}
	public void setSqlMapClientTemplate(SqlMapClientTemplate client){
		this.client = client;
	}
	
	public ArrayList<OrderHistoryVO> selectOrderHistory(HashMap hm) throws SQLException{
		return  (ArrayList<OrderHistoryVO>) client.queryForList("selectOrderHistory" ,hm);
	}
	
	public ArrayList<OrderHistoryVO>  selectOrderHistoryByDeliveryStatus(HashMap hm) throws SQLException{
		return  (ArrayList<OrderHistoryVO>) client.queryForList("selectOrderHistoryByDeliverystatus" ,hm);
	}
	
	public void insertOrderHistoryOne(HashMap map)throws SQLException{
		client.queryForObject("insertOrderHistoryOne",map);
	}
	public int deleteOrderHistroy(String m_id)throws SQLException{
		return client.delete("deleteOrderHistroy", m_id);
	}
	public int deleteOrderHistroyByP_id(String p_id)throws SQLException{
		return client.delete("deleteOrderHistroyByP_id",p_id);
	}
	
}
